package com.example.xksys.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;
import java.util.Map;

@Mapper
public interface CourseMapper {

    List<Map<String,Object> > search(Map<String,String> param);
    @Update("update course set cCurNum=cCurNum+1 where cKey=#{cKey}")
    int add_one(Map<String,String> param);
    @Update("update course set cCurNum=cCurNum-1 where cKey=#{delCKey}")
    int delete_one(Map<String,String> param);

    @Select("select * from course,sc where sc.cKey=course.cKey and sc.loginName=#{loginName}")
    List<Map<String,Object> > have(Map<String,String> param);
}
